# num = 1
# while True:
#     usname = input("请输入用户名：")
#     if usname == "exit":
#         break
#     psswd = input("请输入密码：")
#     if psswd == "exit":
#         break
#     if usname == "lu" and psswd == "1234":
#         print("登录成功！")
#     else:
#         print("账号或密码错误！")
#
#     pass
trycout = 0 # 用于记录登录次数
for trycout in range(3):
    trycout += 1
    usname = input("请输入用户名：")
    psswd = input("请输入密码：")
    if usname == "lu" and psswd == "1234":
        print("登录成功！")
    else:
        print(f"账号或密码错误{trycout}次！")
        print(f"您还有{3 - trycout}次输入机会")
        if trycout >= 3:
            print("密码错误，账号已经锁定！")
            break
